<!DOCTYPE>
<html>
	<head>
		<meta charset='ust-8'>
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<style>
		*{
			padding:0;
			margin:0;
		}
			.head{
				width:100%;
			}
			.head img{
				width:100%;
			}
			.content{
				margin-left:10%;
			}
			.jiang_list{
				height:4rem;
				line-height:4rem;
				margin-top:1rem;
				border:1px solid #bbb;
				border-radius:.5rem;
				width:80%;
				padding-left:.5rem;
			}
			.tab{
			width:100%;
			display:flex;
		}
		.currentShow{
			border-bottom:1px solid #f9bc4f;
		}
		.shuoming{
			text-align:center;
			width:50%;
			height:3rem;
			line-height:3rem;
			cursor:pointer;
		}
		.jiangpin{
			text-align:center;
			width:50%;
			height:3rem;
			line-height:3rem;
			cursor:pointer;
		}
		.lingqu{
			 float:right;width:30%;text-align:center;background-color:#70e9df;
		}
		.chakan{
			 float:right;width:30%;text-align:center;background-color:#96d196;
		}
		.yilingqu{
			 float:right;width:30%;text-align:center;background-color:#bbb;
		}
		</style>
		<link rel="stylesheet" href="/static/layer-v3.1.1/layer/mobile/need/layer.css">
	</head>
	<body>
	<div class='tab'>
		<div class='shuoming' onclick='shuoming()'>活动说明</div>
		<div class='jiangpin currentShow'>我的奖品</div>
	</div>
		<div class='head'>
			<a href = "https://m.10010.com/pushpage/69800000320983.36.html?WT.mc_id=zhejiang_zhejiang_517zhengshi_0515_H5_0001&utm_source=zhejiang&utm_medium=cpc&utm_term=&utm_content=jpg&utm_campaign=zhejiang_zhejiang_517zhengshi_0515_H5_0001"><img src='/static/home/img/jiangpin.jpg'></a>
		</div>
		<div class='content'>
			 {% for  val in  jiangpin %}
			<div class='jiang_list'>
				{{val.name.name}} 
				{% if val.is_get == 1 %}
					<span class='yilingqu'>已领取</span>
				{% else %}
					{% if val.name.type == 'phone' %}
						<span class='lingqu' onclick='lingqu({{val.id}},"{{val.name.type}}")'>领取</span>
					{% else %}
						<span class='chakan' onclick='lingqu({{val.id}},"{{val.name.type}}")'>领取</span>
					{%  endif %}
				{%  endif %}
				
			</div>	
			{% autoescape false %}
			{{val.name.info}}
			{% endautoescape %}
			{% endfor %}	
		</div>
		<script src="/static/common/js/jquery-2.1.4.min.js"></script>
		<script src='/static/layer-v3.1.1/layer/mobile/layer.js'></script>
		<script>
			function shuoming(){
				if( localStorage.getItem("userSelect") == 2 ){
					//联通用户
					window.location.href = '/home/jinlang2.html';
					return;
				}
				window.location.href = '/home/jinlang.html';
			}
			
			function lingqu( uid , type , link){
				if( type == 'link' ){
					/*layer.open({
						content: link
						,btn: '我知道了'
					});*/
					var loding = layer.open({
						type: 2
						,content: '加载中'
					  });
					$.ajax({
						url:'/home/linjiangTwo',
						type:'post',
						dataType:'json',
						data:{lid:uid},
						success:function( data  ){
							layer.close(loding);
							if( data.code == 0 ){
								window.location.href = data.data;
							}else{
								layer.open({
									content: data.message
									,skin: 'msg'
									,time: 3 //2秒后自动关闭
								  });
							}
						}
						
					})
				}else if( type == 'phone' ){
					window.location.href = '/home/lingqu.html?id=' + uid;
				}else{
					layer.open({
						content: '领取错误，请刷新页面重试！'
						,btn: '我知道了'
					});
				}
			}
		
		</script>
	</body>
</html>